% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Replication "Deconstructing the Yield Curve"
% Crump and Gospodinov (2024)
% Date: 26-JUL-2024
% Function for making p-values from bootstrapped objects
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
function pval = makeBsPval(bsBetaHat,betaHat,bsBetaSE,tStat,istart) 

    pval = NaN(size(betaHat));
    for i = istart:numel(pval)
        pval(i) = mean(abs((bsBetaHat(:,i) - betaHat(i))./(bsBetaSE(:,i)))>abs(tStat(i))); 
    end

end